<?php
class App_Module_Admin_ExceptionHandler_Http_Web extends Mozg_ExceptionHandler
{
    protected function HandleNotAuthorized(Exception $e)
    {
        Mozg::Layout('admin')->SetTemplate('login');
        $t = $this->GetTpl('Error');
        $t->user = Mozg::User();
        $t->postedData = Mozg::Request('http')->PostToInputs();
        Mozg::Response('http')->SetBody($t->LoginForm());
    }

    protected function HandleNotAcceptable(Exception $e)
    {
        Mozg::Layout('admin')->SetTemplate('login');
        $t = $this->GetTpl('Error');
        Mozg::Response('http')->SetBody($t->NotAccess());
    }

    protected function HandleNotFound(Exception $e)
    {
        Mozg::Response('http')->setHttpResponseCode(404);
        Mozg::Layout('admin')->SetTemplate('login');
        $t = $this->GetTpl('Error');
        $t->e = $e;
        Mozg::Response('http')->SetBody($t->NotFound());
    }
}